package com.base.cn.platform.os.service.manage.op.advert;

import com.base.cn.platform.os.service.FeignAuthConfig;
import com.base.cn.platform.os.service.manage.BaseService;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * 广告接口
 * @author ll
 * @create 2018-05-17
 */
@FeignClient(name = BaseService.appName , configuration = FeignAuthConfig.class)
public interface OpAdvertService extends BaseService {


    /**
     * 搜索广告列表
     * @param opAdvert 广告搜索条件
     * @param currentPage 分页
     * @param courseData 课程
     * @param createUserData 创建用户
     * @param advertPlaceData 广告位置
     * @return
     */
    @RequestMapping(contextPath + "/op/queryAdvertListPage")
    Map<String,Object> queryAdvertListPage(@RequestBody Map<String, Object> opAdvert,
                                           @RequestParam("currentPage") Integer currentPage,
                                           @RequestParam("courseData") boolean courseData,
                                           @RequestParam("createUserData") boolean createUserData,
                                           @RequestParam("advertPlaceData") boolean advertPlaceData);

    /**
     * 搜索广告列表
     * @param opAdvert 广告搜索条件
     * @param courseData 课程
     * @param createUserData 创建用户
     * @param advertPlaceData 广告位置
     * @return
     */
    @RequestMapping(contextPath + "/op/queryAdvertList")
    List<Map<String,Object>> queryAdvertList(@RequestBody Map<String, Object> opAdvert,
                                             @RequestParam("courseData") boolean courseData,
                                             @RequestParam("createUserData") boolean createUserData,
                                             @RequestParam("advertPlaceData") boolean advertPlaceData);


    /**
     * 添加修改广告
     * @param opAdvert
     * @return
     */
    @RequestMapping(contextPath + "/op/saveUpdateOpAdvert")
    Map<String,Object> saveUpdateOpAdvert(@RequestBody Map<String, Object> opAdvert);


    /**
     * 删除广告
     * @param ids
     * @return
     */
    @RequestMapping(contextPath + "/op/deleteAdvertByIds")
    Map<String,Object> deleteAdvertByIds(@RequestParam("ids") String ids);



    /**
     * 搜索广告
     * @param id 广告搜索条件
     * @param courseData 课程
     * @param createUserData 创建用户
     * @param advertPlaceData 广告位置
     * @return
     */
    @RequestMapping(contextPath + "/op/queryOpAdvertById")
    Map<String,Object> queryOpAdvertById(@RequestParam(value = "id") BigDecimal id,
                                         @RequestParam(value = "courseData", required = false, defaultValue = "false") boolean courseData,
                                         @RequestParam(value = "createUserData", required = false, defaultValue = "false") boolean createUserData,
                                         @RequestParam(value = "advertPlaceData", required = false, defaultValue = "false") boolean advertPlaceData);


    /**
     * 修改广告状态
     * @param ids
     * @param status
     * @return
     */
    @RequestMapping(contextPath + "/op/updateOpAdvertStatus")
    Map<String,Object> updateOpAdvertStatus(@RequestParam("ids") String ids,
                                            @RequestParam("status") Integer status);


}
